package com.example.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-07-22
 * Time: 16:05
 */
@Component
public class Test {
@Value("${server.port}")
    private String port;
@Value("${spring.datasource.url}")
    private  String url;
    @Value("${string.str1}")
    private String str1;
    @Value("${string.str2}")
    private String str2;
    @Value("${string.str3}")
    private String str3;
  @PostConstruct
public void  setPort(){
      System.out.println(port);
      System.out.println(url);
      System.out.println("string.str1：" + str1);
      System.out.println("string.str2：" + str2);
      System.out.println("string.str3：" + str3);
}

}
